<?php

class DB_SORT extends ORM_Table {
    static protected $table_name = 'sort';

    static public function getTableName($params = null) {
        //$table_name = self::$table_name.substr($params['article_type_id'], 0, 1);
        return self::$table_name;
    }

    //添加分类
    static function Add($title, $intro='无') {
        $sort   = new Sort();
        $sort->setTitle($title);
        $sort->setUid($_SESSION['user']['id']);
        $sort->setIntro($intro);
        $sort->save();
        return $sort->getId();
    }
}

